package com.tanhua.server.interceptor;

import com.tanhua.domain.db.User;

public class UserHolder {

    private static ThreadLocal<User> threadLocal = new ThreadLocal<>();


    public static User get(){
        return threadLocal.get();
    }

    public static void set(User user){
        threadLocal.set(user);
    }

    public static Long getUserId(){
        return get().getId();
    }
}
